# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=dietlibc
pkgver=0.33
pkgrel=3
pkgdesc="a libc optimized for small size"
url="https://www.fefe.de/dietlibc/"
arch=""
license="GPL"
depends="dietlibc-dev"
depends_dev=""
makedepends=""
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="https://www.fefe.de/$pkgname/$pkgname-$pkgver.tar.bz2"

_builddir="$srcdir"/$pkgname-$pkgver
build() {
	make prefix=/usr/$pkgname \
		-C "$_builddir" || return 1
}

package() {
	make prefix=/usr/$pkgname DESTDIR="$pkgdir" \
		BINDIR=/usr/bin MAN1DIR=/usr/share/man/man1 \
		-C "$_builddir" install || return 1

	local file
	for file in AUTHOR BUGS CAVEAT CHANGES COPYING FAQ PORTING \
			README README.security SECURITY THANKS TODO; do
		install -Dm644 "$_builddir"/$file \
			"$pkgdir"/usr/share/doc/$pkgname/$file || return 1
	done
}

md5sums="9d541b9a6623b04ec12e5248b82db7c0  dietlibc-0.33.tar.bz2"
sha256sums="68838893790ddd7a42bc1a06e5435054e1dc1914e4b53d2d6c92f603d3b315f5  dietlibc-0.33.tar.bz2"
sha512sums="3e4cc8d9987a497adb2f777cbd578aa46a44f786a6ed86b0e2489d1f72ffd915920828b3dfb46d62d25f4b6a1cc2cbf7cc806ca0fe56ebc1af49152f5d4950a3  dietlibc-0.33.tar.bz2"
